package com.rice.commonsdk.template;

import lombok.Data;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Data
public class FixedExecutorTemplate {
    private ExecutorService executorService;

    public FixedExecutorTemplate(int fixedPoolSize) {
        this.executorService = Executors.newFixedThreadPool(fixedPoolSize);
    }

    public void submit(Runnable task) {
        this.executorService.submit(task);
    }
}
